xen/arm: vsmc: Don't implement function IDs that don't exist
authorJulien Grall <julien.grall@linaro.org>
Tue, 6 Feb 2018 15:53:24 +0000 (15:53 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 9 Feb 2018 00:13:54 +0000 (16:13 -0800)
commit6dadaabbc884e5bdde24b32a67e64b1adf726274
tree170ee05531f3dd3987768872681e8a70759abef5
parent8fd0eb22395e805bb698bf0555683072f03e5398
xen/arm: vsmc: Don't implement function IDs that don't exist

The current implementation of SMCCC relies on the fact only the function
number (bits [15:0]) is enough to identify what to implement.

However, PSCI call are only available in the range 0x84000000-0x8400001F
and 0xC4000000-0xC400001F. Furthermore, not all SMC32 functions have
equivalent in the SMC64. This is the case of:
    * PSCI_VERSION
    * CPU_OFF
    * MIGRATE_INFO_TYPE
    * SYSTEM_OFF
    * SYSTEM_RESET

Similarly call count, call uid, revision can only be query using smc32/hvc32
fast calls (See 6.2 in ARM DEN 0028B).

Xen should only implement identifier existing in the specification in
order to avoid potential clashes with later revision. Therefore rework the
vsmc code to use the whole function identifier rather than only the
function number.

At the same time, the new macros for call count, call uid, revision are
renamed to better suit the spec.

Lastly, update SSSC_SMCCC_FUNCTION_COUNT to match the correct number of
funtions. Note that version is not updated because the number has always
been wrong, and nobody could properly use it.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/vsmc.c
xen/include/asm-arm/smccc.h